﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>图片展示跑马灯配置</title>
    <style type="text/css">
        /*---------公共元素---------------------------------------*/* { padding: 0; margin: 0; font-size: 12px; font-family: Arial,宋体,Tahoma; }
        body { padding: 12px; background-color: #fff; }
        table, tr, td { border-collapse: collapse; }
        input, img { vertical-align: middle; }
        input { padding: 2px; }
        img { border: 0; }
        ul, li { list-style-type: none; }
        /*--------------------------------------------------------*//* 链接颜色 */a:link { color: #328916; text-decoration: none; }
        a:visited { color: #328916; text-decoration: none; }
        a:hover { color: #328916; text-decoration: underline; }
        a:active { color: #328916; }
        /*------------------公共类---------------------------------*//*.content { margin: 0 auto; width: 980px; }*/.ptitle { padding: 5px; height: 17px; border: solid 1px #97C193; background: url(/crm/images/bgt.jpg) repeat-x; margin-top: 20px; font-weight: bold; font-size: 14px; }
        .inputtxt { padding: 4px; border: solid 1px #C3C3C3; border-top: solid 1px #7C7C7C; background-color: #fff; }
        .tblist tr td { padding: 5px; border: solid 1px #97C193; }
        .tblist tr td div td { padding: 0px; border: 0; }
        /*表格样式2*/.tb2 tr td { padding: 5px; border: solid 1px #C5E7C6; }
        .tb2 .nav { height: 28px; background: #ffffff url(/images/my/bg_grid_m.png) repeat-x; }
        .tb2 .nav td { font-weight: bold; font-size: 14px; color: #333; padding: 10px 20px; }
        .tb2 .bg { background-color: #F6FBF2; }
    </style>

    <script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>

    <script src="../filewatch/lhgdialog/lhgdialog.min.js" type="text/javascript"></script>

    <script type="text/javascript">
        function getparas(item)
        {
            var svalue = location.search.match(new RegExp("[\?\&]" + item + "=([^\&]*)(\&?)", "i"));
            return svalue ? svalue[1] : svalue;
        }
        $(document).ready(function()
        {
            //加载配置
            $.post("/ashx/postop.ashx?ac=getdatapluginconfig", { type: getparas("type"), id: getparas("id"), fn: getparas("fn") }, function(res)
            {
                try
                {
                    var jsondata = eval("[" + res + "]");
                    $("#txtframew").val(jsondata[0].jcarousel_framewidth);
                    $("#txtframeh").val(jsondata[0].jcarousel_frameheight);
                    $("#txtWidth").val(jsondata[0].jcarousel_picwidth);
                    $("#txtHeight").val(jsondata[0].jcarousel_picheight);
                    $("#txtdelaytime").val(jsondata[0].jcarousel_delaytime);
                    $("#hidbid").val(jsondata[0].jcarousel_bid);                   
                   
                } catch (ex) {  }
            });
            $("#btncreate").click(function()
            {
                if (!getparas("id"))
                {
                    alert("参数传递不完整!");
                    return false;
                }
                var str = "";
                //var jcarousel_framewidth, jcarousel_frameheight, jcarousel_picwidth, jcarousel_picheight, jcarousel_bid, jcarousel_delaytime;
                str += "<scr" + "ipt type=\"text/javascr" + "ipt\">\n";
                str += " var jcarousel_framewidth = " + $.trim($("#txtframew").val()) + "; //框架宽度\n";
                str += " var jcarousel_frameheight =  " + $.trim($("#txtframeh").val()) + "; //框架高度\n";
                
                str += " var jcarousel_picwidth = " + $.trim($("#txtWidth").val()) + "; //图片宽度\n";
                str += " var jcarousel_picheight =  " + $.trim($("#txtHeight").val()) + "; //图片高度\n";
                str += " var jcarousel_bid = " + $.trim($("#hidbid").val())+"; //栏目编号\n";

                str += " var jcarousel_delaytime = " + $.trim($("#txtdelaytime").val())  + "; //图片停留时间(秒)\n";    
        
                str += " </scri" + "pt>\n";
                str += " <scr" + "ipt type=\"text/javascript\" src=\"/plugins/jcarousel/show.js\"></scr" + "ipt>\n";
              
                var paras = "{\"jcarousel_framewidth\":\"" + $.trim($("#txtframew").val()) + "\",\"jcarousel_frameheight\":\"" + $.trim($("#txtframeh").val()) + "\",\"jcarousel_picwidth\":\"" + $.trim($("#txtWidth").val()) + "\",\"jcarousel_picheight\":\"" + $.trim($("#txtHeight").val()) + "\",\"jcarousel_bid\":\"" + $.trim($("#hidbid").val()) + "\",\"jcarousel_delaytime\":\"" + $.trim($("#txtdelaytime").val()) + "\"}";
                $.post("/ashx/postop.ashx?ac=pluginconfig", { type: getparas("type"), id: getparas("id"), fn: getparas("fn"), datastr: str, paras: paras }, function(res)
                {
                    var DG = frameElement.lhgDG;
                    if (DG != null)
                    {
                        top.ReLoad();
                        DG.cancel();
                    }
                });
            });    
        });
    </script>

</head>
<body>
    <form id="form1" runat="server">
    <div style="width: 600px;">
        图片展示跑马灯配置
        <table id="tb1" class="tb2">
            <thead>  
            <tr>
                    <td colspan="4" align="left" style="text-align: left;">
                        框架宽度：<input id="txtframew" style="width: 50px;" value="300" maxlength="4" type="text" />&nbsp;&nbsp;
                        框架高度：<input id="txtframeh" type="text" value="200" maxlength="4" style="width: 50px;" />                     
                    </td>
                </tr>
                <tr>
                    <td colspan="4" align="left" style="text-align: left;">
                        图片宽度：<input id="txtWidth" style="width: 50px;" value="300" maxlength="4" type="text" />&nbsp;&nbsp;
                        图片高度：<input id="txtHeight" type="text" value="200" maxlength="4" style="width: 50px;" />
                       <!-- 显示个数：<input id="txtpicnum" type="text" maxlength="4" value="6" style="width: 50px;" />-->
                       <input type="text" value="4" id="hidbid" />
                        提留时间：<input id="txtdelaytime" type="text" maxlength="4" value="6" style="width: 50px;" />秒
                    </td>
                </tr>
              
            </thead>            
        </table>
        <input type="button" id="btncreate" value="提交" />
    </div>
    </form>
</body>
</html>
